package com.bianguo.android.apushdemo.view.activity;

import android.support.annotation.Nullable;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.bianguo.android.apushdemo.R;
import com.bianguo.android.apushdemo.adapter.ScheduleAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;
import cn.zhouchaoyuan.excelpanel.ExcelPanel;

public class ScheduleActivity extends BaseActivity {

    @BindView(R.id.title_title)
    TextView titleTitle;
    @BindView(R.id.schedule_excel)
    ExcelPanel scheduleExcel;

    private ScheduleAdapter adapter;
    private ArrayList<String> leftData, topData, emptyData;
    private List<List<String>> majorData;

    @Override
    public int layoutId() {
        return R.layout.activity_schedule;
    }

    @Override
    public void initView(@Nullable Bundle savedInstanceState) {
        titleTitle.setText("日程");
        leftData = new ArrayList<>();
        topData = new ArrayList<>();
        emptyData = new ArrayList<>();
        majorData = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            leftData.add("left " + i);
            topData.add("top " + i);
            emptyData.add("major " + i);
        }
        for (int i = 0; i < 20; i++) {
            majorData.add(emptyData);
        }
        adapter = new ScheduleAdapter(mContext);
        scheduleExcel.setAdapter(adapter);
        adapter.setAllData(leftData, topData, majorData);
    }

    @OnClick({R.id.title_left_ib})
    public void onClickBk(View view) {
        switch (view.getId()) {
            case R.id.title_left_ib:
                onBackPressed();
                break;
        }
    }
}
